package bcslib

import (
	"encoding/json"
	u "lpaiche.com/utils"
)

type BailSummary struct {
	Dealer_id        int64
	Bail_amount      float64
	Freeze_amount    float64
	Indemnity_amount float64
	Contact_person   string
	Minus_amount     float64
}

type BailLog struct {
	Dealer_id       int64
	Order_id        int64
	Use_time        string
	Use_type        int64
	Use_detail      string
	Occur_money     float64
	Remain_amount   float64
	Recharge_method int64
	Recharge_no     string
	Createtime      string
	Free_bl_id      int64
	Is_free         int64
	Recharge_id     int64
	Collection_id   int64
	Payment_id      int64
}

type BailQueueContext struct {
	Summary BailSummary
	Log     BailLog
}

func JsonStr2BailQueueContext(str string) BailQueueContext {
	var bqc BailQueueContext
	jsonBlob := []byte(str)
	err := json.Unmarshal(jsonBlob, &bqc)
	if err != nil {
		u.Trace(err)
	}
	return bqc
}
